<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Homework 2-3</title>

</head>
<body>
    <div class="Q5">
        <p>5、下拉框随机选择</p>
        <select name="Q5" id="Q5">
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
            <option value="4">4</option>
        </select>
        <button onclick="Q5()">随机</button>
    </div>
    <div class="Q6">
        <p>6、文本框效果</p>
        <input type="text" value="请输入搜索关键字" id = "Q6" style= "color:black" >
    </div>
    <div class="Q7">
        <p>7、class属性</p>
        <button onclick="Q7()">点我展示二维码</button>
        <div class="erweima hide" id="er">
            <span>我是二维码,我的class名有erweima，hide</span>
        </div>
    </div>
    <div class="Q8">
        <p>8、一组文本框</p>
        <input class= "input8" type="text"><br>
        <input class= "input8" type="text"><br>
        <input class= "input8" type="text"><br>
        <input class= "input8" type="text"><br>
        <input class= "input8" type="text"><br>
        <div class="erweima hide" id="er">
            <span>我是二维码,我的class名有erweima，hide</span>
        </div>
    </div>
    <div class="Q9">
        <p>9、无序列表</p>
        <input type="text" placeholder="添加列表项" id = "Q9">
        <button onclick="Q9()">添加</button>
        <ul id = "Q9List">
        </ul>
    </div>
    <div class="Q10">
        <p>10、列表事件委托</p>
        <ul id = "Q10List">
            <li style = "background-color: green;">111111</li>
            <li style = "background-color: green;">222222</li>
            <li style = "background-color: green;">333333</li>
            <li style = "background-color: green;">444444</li>
            <li style = "background-color: green;">555555</li>
        </ul>
    </div>

    <div class="Q11">
        <p>11、注册事件函数</p>
        <xmp>
            function addEvent(ele,type,fn) {
                if (ele.addEventListener) {
                  ele.addEventListener(type,fn);
                } else if (ele.attachEvent) {
                  ele.attachEvent("on" + type,fn);
                }
                else {
                    ele["on" + type]= fn;
                }
            }
        </xmp>
    </div>

    <div class="Q12">
        <p>12、j定时器错误解决</p>
        <span>可以在全局添加一个定时器，在点击事件触发后，交互区域暂时进入固定冷却时间，才允许下一次交互，效果如下方按钮</span><br>
        <button onclick="Q12()" id = "Q12btn">事件交互</button>
    </div>

    <script src="hw2-3.js"></script>
</body>

</html>